﻿using Deployment.Data.Environment.Connection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Data;

namespace Deployment.Data.UI.Converters
{
    public class ObjectToAbstractConnectionControl : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            AbstractConnection con = value as AbstractConnection;
            if (con != null)
            {
                return con.EditorControl;
            }
            Label Default = new Label();
            if (parameter is string)
            {
                Default.Content = parameter as string;
            }
            else
            {
                Default.Content = "No Connection Selected...";
            }
            
            return Default;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
